package homework;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

/**
 * @description: TODO
 * @author yumo
 * @version: 1.0
 * @date 2025/3/14 18:22
 */
public class Notepad {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("note.txt");
        Scanner scan=new Scanner(System.in);
        while (true){
            String write=scan.nextLine();
            if ("exit".equals(write)){
                break;
            }else {
                byte[]data=write.getBytes(StandardCharsets.UTF_8);
                fos.write(data);
            }
        }
        System.out.println("写入完成");
        fos.close();

    }
}
